package com.market.manager;

import java.util.Date;
import java.util.List;

import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.market.domain.Location;
import com.market.domain.Promotion;

public interface PromotionManager extends GenericManager<Promotion, Long> {
	
	/**
	 * Load locations that associate to this promotion
	 * @param promotion
	 * @return
	 */
	@Transactional(propagation = Propagation.REQUIRED,readOnly=true)
	public List<Location> fetchLocations(Promotion promotion);
	
	
	/**
	 * Load all valid promotion on specific date.
	 * @param date
	 * @return
	 */
	public List<Promotion> fetchValidPromotions(Date date, Long locationId);

}
